normal_vector_to_line Function

public pure function normal_vector_to_line(pt1, pt2, pt) result(rst)

Computes the normal vector to a line defined by pt1 and pt2 assuming some point (pt) not on the line.

Arguments

Type IntentOptional Attributes Name
class(point), intent(in) :: pt1

The origin point of the line segment.

class(point), intent(in) :: pt2

The termination point of the line segment.

class(point), intent(in) :: pt

A point, not on the line.

Return Value real(kind=real64), (3)

The resulting normal vector (unit length).


Contents